﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using Film.Common;
using Film.Repository;

namespace PhuongDoAn.UC
{
    public partial class uc_home : System.Web.UI.UserControl
    {
        int pageSize = 10;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Page_PreRender(object sender, EventArgs e)
        {

            try
            {
                List<tblMovieTemp> result = new List<tblMovieTemp>();
                tblMovieRepository movieRepository = new tblMovieRepository();


                result = movieRepository.GetAllOrderbyRating(pageSize).OrderByDescending(c => c.ToTalRatingSum).ToList();

                rptData.DataSource = result;
                rptData.DataBind();

            }
            catch (Exception ex)
            {
                Page.Response.Write("error" + ex.Message + " : " + ex.StackTrace);
            }
        }
    }
}